package com.xy.biz.mes.domain.converter;

import com.xy.biz.mes.domain.po.ManufactureTaskEquipmentPO;
import com.xy.biz.mes.domain.bo.ManufactureTaskEquipmentBO;
import com.xy.biz.mes.domain.req.SaveManufactureTaskEquipmentRequest;
import com.xy.biz.mes.domain.resp.GetManufactureTaskEquipmentResponse;
import com.xy.tool.util.BeanUtilsEx;

import java.util.Collection;
import java.util.List;

/**
 *
 *
 * @author zsp
 * @date 2022-1-6
 */
public class ManufactureTaskEquipmentConverter {

	public static ManufactureTaskEquipmentPO toPO(ManufactureTaskEquipmentBO source) {
		return BeanUtilsEx.copyProperties(source, () -> new ManufactureTaskEquipmentPO(), true);
	}

	public static List<ManufactureTaskEquipmentPO> toPO(Collection<ManufactureTaskEquipmentBO> source) {
		return BeanUtilsEx.copyPropertiesForNewList(source, () -> new ManufactureTaskEquipmentPO(), true);
	}

	public static ManufactureTaskEquipmentBO fromPO(ManufactureTaskEquipmentPO source) {
		return BeanUtilsEx.copyProperties(source, () -> new ManufactureTaskEquipmentBO());
	}

	public static List<ManufactureTaskEquipmentBO> fromPO(Collection<ManufactureTaskEquipmentPO> source) {
		return BeanUtilsEx.copyPropertiesForNewList(source, () -> new ManufactureTaskEquipmentBO());
	}

	public static ManufactureTaskEquipmentBO toBO(SaveManufactureTaskEquipmentRequest source) {
		return BeanUtilsEx.copyProperties(source, () -> new ManufactureTaskEquipmentBO(), true);
	}

	public static List<ManufactureTaskEquipmentBO> toBO(Collection<SaveManufactureTaskEquipmentRequest> source) {
		return BeanUtilsEx.copyPropertiesForNewList(source, () -> new ManufactureTaskEquipmentBO(), true);
	}

	public static GetManufactureTaskEquipmentResponse toResponse(ManufactureTaskEquipmentBO source) {
		return BeanUtilsEx.copyProperties(source, () -> new GetManufactureTaskEquipmentResponse());
	}

	public static List<GetManufactureTaskEquipmentResponse> toResponse(Collection<ManufactureTaskEquipmentBO> source) {
		return BeanUtilsEx.copyPropertiesForNewList(source, () -> new GetManufactureTaskEquipmentResponse());
	}

}
